/*
 * Copyright (c) 2015 4 13
 * Name:wuPeiJi
 * QQ:757671834
 */

package kali.wpj.kali.util;

import android.content.Context;

import com.gitonway.lee.niftymodaldialogeffects.lib.Effectstype;
import com.gitonway.lee.niftymodaldialogeffects.lib.NiftyDialogBuilder;

import kali.wpj.kali.R;

/**
 * Created by wpj on 2015/4/13.
 */
public class DialogBuilderTools {
    private Context context;
    public DialogBuilderTools(Context context){
        this.context=context;

    }
    public void dialogShow(String str){
        NiftyDialogBuilder dialogBuilder=NiftyDialogBuilder.getInstance(context);
        dialogBuilder
                .withTitle(context.getString(R.string.warning))                                  //.withTitle(null)  no title
                .withTitleColor("#FFFFFF")                                  //def
                .withDividerColor("#11000000")                              //def
                .withMessage(str)                     //.withMessage(null)  no Msg
                .withMessageColor("#FFFFFFFF")                              //def  | withMessageColor(int resid)
                .withDialogColor(context.getString(R.string.black))                               //def  | withDialogColor(int resid)                               //def
                .isCancelableOnTouchOutside(true)                           //def    | isCancelable(true)
                .withDuration(700)                                          //def
                .withEffect(Effectstype.RotateBottom)
                .withIcon(context.getResources().getDrawable(R.drawable.icon))//def Effectstype.Slidetop
                .setCustomView(R.layout.custom_view,context)         //.setCustomView(View or ResId,context)
                .show();

    }

}
